import request from '@/utils/request'

// 查询电桩线路状态
export function getRoadState(data) {
  return request({
    url: '/equipment/operation/road/state',
    method: 'post',
    data: data
  })
}


export function roadOpen(data) {
  return request({
    url: '/equipment/operation/openDev',
    method: 'post',
    data: data
  })
}

export function roadClose(data) {
  return request({
    url: '/equipment/operation/shut',
    method: 'post',
    data: data
  })
}


// 获取版本
export function getVer(data) {
  return request({
    url: '/equipment/operation/version',
    method: 'post',
    data: data
  })
}

// 重启设备
export function restart(data) {
  return request({
    url: '/equipment/operation/restart',
    method: 'post',
    data: data
  })
}

// 查询温度
export function getTemp(sn) {
  return request({
    url: '/equipment/operation/temperature/' + sn,
    method: 'get',
  })
}

// 查询电桩功率
export function getPow(data) {
  return request({
    url: '/equipment/operation/pow',
    method: 'post',
    data: data
  })
}

// 查询设备充电属性
export function getAttr(sn) {
  return request({
    url: '/equipment/charge/attribute/' + sn,
    method: 'get'
  })
}

// 修改设备充电属性
export function setAttr(data) {
  return request({
    url: '/equipment/charge/attribute',
    method: 'put',
    data: data
  })
}

// 查询设备保护属性
export function getProdAttr(sn) {
  return request({
    url: '/equipment/protect/attribute/' + sn,
    method: 'get'
  })
}

// 修改设备保护属性
export function setProdAttr(data) {
  return request({
    url: '/equipment/protect/attribute',
    method: 'put',
    data: data
  })
}

// 查询设备刷卡设置
export function getCard(sn) {
  return request({
    url: '/equipment/card/standard/' + sn,
    method: 'get'
  })
}

// 修改设备刷卡设置
export function setCard(data) {
  return request({
    url: '/equipment/card/standard',
    method: 'put',
    data: data
  })
}

// 查询漏电值
export function getLeakElec(sn) {
  return request({
    url: '/equipment/operation/leakElec/' + sn,
    method: 'get'
  })
}

// 查询实时漏电
export function getLeakElecNow(sn) {
  return request({
    url: '/equipment/operation/onlineLeakElec/' + sn,
    method: 'get'
  })
}

// 设置漏电值
export function setLeakElec(data) {
  return request({
    url: '/equipment/operation/leakElec',
    method: 'post',
    data: data
  })
}

// 校准标定
export function standardPower(sn) {
  return request({
    url: '/equipment/operation/standardPower/' + sn,
    method: 'get'
  })
}


// 获取imei
export function getImei(sn) {
  return request({
    url: '/equipment/operation/imei/' + sn,
    method: 'get'
  })
}

// 获取十路功率
export function getPower(sn) {
  return request({
    url: '/equipment/operation/10/power/' + sn,
    method: 'get'
  })
}

// 一键开启
export function debugOpen(data) {
  return request({
    url: '/equipment/operation/debugOpen',
    method: 'post',
    data: data
  })
}
